//组合风险分解
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { ExportC, SecondHeaderC, ThreeHeaderC } from '../../../../../../../comps';
import myStyle from '../index.less';
import DecompositionMap from './decompositionMap';
import ExcessTrend from './ExcessTrend';
@connect(({ loading, exposureAnalysisM }) => ({ loading, exposureAnalysisM }))
export default class PortfolioRisk extends PureComponent {
  state = {
    url: 'gateway/maat-workstation/factorExposure/downloadRiskContributionDetail',
  };

  render() {
    const { searchData } = this.props;
    let querys = { ...searchData };
    delete querys.portfolioName;
    delete querys.timeRange;
    return (
      <div>
        <SecondHeaderC title='组合风险分解' Right={<ExportC url={this.state.url} search={querys} />} />
        <div className={myStyle.portfolioRisk}>
          <div>
            <ThreeHeaderC title={`风险分层拆解图(${querys.endDate})`} />
            <DecompositionMap args={querys} />
          </div>
          <div>
            <ThreeHeaderC title={`超额风险趋势图`} />
            <ExcessTrend args={querys} />
          </div>
        </div>
      </div>
    );
  }
}
